<%-- 
    Document   : ExamenActualizar2
    Created on : 10/10/2011, 04:43:13 PM
    Author     : Alumnos
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
        Connection conn = null;
        try {
            String sc = "jdbc:mysql://localhost:3306/upeu?user=root&password=";
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection(sc);
            System.out.println("Conectado");
            //test
          
            
            String userid = request.getParameter("userid");
            String nombre = request.getParameter("nombre");
            String  photo = request.getParameter("photo");
            String  email=request.getParameter("email");
            String  celular=request.getParameter("celular");
            String  login=request.getParameter("login");
            String  Password=request.getParameter("Password"); 
            String  privilege=request.getParameter("privilege");
            String  activeaccount=request.getParameter("activeaccount");
            String  ForcePasswordChange=request.getParameter("ForcePasswordChange");
            String  DateCreate=request.getParameter("DateCreate");
          
            
            String qry= " UPDATE User SET nombre='"+nombre+"',photo='"+photo+"',email='"+email+"',celular='"+celular+"' ,login='"+login+"', Password='"+Password+"',privilege='"+privilege+"',activeaccount='"+activeaccount+"', ForcePasswordChange='"+ForcePasswordChange+"',DateCreate='"+DateCreate+"' , WHERE Userid='"+userid+"'";
            PreparedStatement ps=conn.prepareStatement(qry);
            int r=ps.executeUpdate();
            out.println(r+" registros modificados en la tabla user "+"<br>");
            
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }
%>
<a href="ExamenMain.jsp"> Regresar al Menu Principal </a>


    </body>
</html>